import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    arr: [],
    newarr: []
  },
  getters: {
  },
  mutations: {
    //增加
    addin(state, payload) {
      state.arr.push(payload)
    },
    // 删除
    cutout(state, payload) {
      state.arr.splice(payload, 1)
    },
    //完成，增加
    success(state, payload) {
      state.newarr.push(state.arr[payload])
      state.arr.splice(payload, 1)
    },
    //完成，删除
    newcut(state, payload) {
      state.newarr.splice(payload, 1)
    },
  },
  actions: {
  },
  modules: {
  }
})
